package com.kevintam;

/**
 * 递归的阶乘
 */
public class Factorial {
    public Integer factorial(int n) {
        return n == 1 ? 1 : n * factorial(n - 1);
    }

    public static void main(String[] args) {
        Factorial f = new Factorial();
        System.out.println(f.factorial(10));
    }
}
